package com.example.test.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.test.bean.BasicArea;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

public interface BasicAreaMapper extends BaseMapper<BasicArea> {

    BasicArea selectByPrimaryKey(String id);

//    String selectHanshu();

//    @Select("CREATE OR REPLACE ALGORITHM=TEMPTABLE VIEW  " +
//            "v_device(device_id,mark,name,area_point_id,area_point_name)AS  " +
//            "SELECT a.device_id,a.mark,a.device_name,d.area_point_id,d.area_point_name FROM ass_device a  " +
//            "LEFT JOIN `ass_device_area_point` d ON d.device_code = a.device_code " +
//            "WHERE a.mark =1")
//    void shitu();

    //    @Select("SELECT * FROM v_device")
//    List<Map<String, Object>> setlectshitu();
    @Select("SELECT * FROM basic_area")
    List<Map<String, Object>> query();

    @Update("update basic_area set name=#{name} where id=#{id}")
    void update(@Param("id") String id, @Param("name") String name);
}